【大数据】YARN常用命令及Rest API 您所在的位置:网站首页 hadoop api中文版 【大数据】YARN常用命令及Rest API

【大数据】YARN常用命令及Rest API

2024-06-27 17:38| 来源: 网络整理| 查看: 265

YARN 1.YARN常用命令 1.1 作业 命令说明yarn application -list列出所有的applicationyarn application -list -appStates [ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED]根据application状态过滤yarn application -kill [applicationId]Kill掉application

查看所有任务

yarn application -list

查看指定任务状态的作业

# state 可选的有:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED yarn application -list -appStates # 示例 yarn application -list -appStates RUNNING,ACCEPTED

查看正在运行的任务信息

yarn applicationattempt -list

结束作业

yarn application -kill 1.2 日志

查询指定作业的日志

# 如果提示内存限制,可以在如下命令后,添加 --size -1 yarn logs -applicationId

查询指定 Container 的日志

yarn logs -applicationId -containerId 1.3 Application Attempt 命令说明yarn applicationattempt -list [ApplicationId]列出所有Application尝试的列表yarn applicationattempt -status [ApplicationAttemptId]打印Application Attempt的状态

列出Application的所有尝试

yarn applicationattempt -list [ApplicationId]

打印Application Attempt的状态

yarn applicationattempt -status [ApplicationAttemptId]

1.4 容器 命令说明yarn container -list [ApplicationAttemptId]列出所有的Containeryarn container -status [ContainerId]打印Container状态

列出所有的Container

yarn container -list [ApplicationAttemptId]

打印Container状态

yarn container -status [ContainerId]

1.5 其他 命令说明yarn node -list -all查看节点状态yarn rmadmin -refreshQueues加载队列配置yarn queue -status [QueueName]打印队列信息

查看节点状态

yarn node -list -all

加载队列配置

# 需要在RM节点执行 yarn rmadmin -refreshQueues

查看队列状态

yarn queue -status [QueueName]

2.YARN Rest Api

YARN Rest Api文档地址:Apache Hadoop 3.3.6 – ResourceManager REST APIs.

2.1 集群

获取 RM 节点状态

# URL http://rm-http-address:port/ws/v1/cluster/info # Method GET # 示例 curl -X GET -u e3base:'Sit@Paas&123' -i "http://172.21.9.101:13006/ws/v1/cluster/info" # 注:如果集群集成了kerbeors,需要增加--negotiate参数

获取集群Metrics

# URL http://rm-http-address:port/ws/v1/cluster/metrics # Method GET # 示例 curl -X GET -u e3base:'Sit@Paas&123' -i "http://172.21.9.101:13006/ws/v1/cluster/metrics" # 注:如果集群集成了kerbeors,需要增加--negotiate参数

2.2 队列

获取集群队列

# URL http://rm-http-address:port/ws/v1/cluster/scheduler # Method GET # 示例 curl -X GET -u e3base:'Sit@Paas&123' -i "http://172.21.9.101:13006/ws/v1/cluster/scheduler" # 注:如果集群集成了kerbeors,需要增加--negotiate参数

2.3 作业

获取集群作业

# URL http://rm-http-address:port/ws/v1/cluster/apps # Method GET # 示例 curl -X GET -u e3base:'Sit@Paas&123' -i "http://172.21.9.101:13006/ws/v1/cluster/apps" # 注:如果集群集成了kerbeors,需要增加--negotiate参数

3.其他 3.1 相关资源

YARN官方文档:Hadoop – Apache Hadoop 3.3.6

大数据之Hadoop集群中YARN常用命令:https://www.cnblogs.com/sw-code/p/16387038.html



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有